package com.cc.alltype.wechat;

/**
 * @author chanchaw
 * @create 2024-11-29 14:16
 */
public enum QrType {
    TEMP(0,"临时二维码","临时二维码"),PERMANENT(1,"永久二维码","永久二维码")
    ;
    private int id;
    private String sid;
    private String remark;
    public int getId() {return id;}
    public String getSid() {return sid;}
    public String getRemark() {return remark;}

    QrType(int id,String sid, String remark) {
        this.id = id;
        this.sid = sid;
        this.remark = remark;
    }

    // 根据索引返回枚举值
    public static QrType ofId(int id){
        for(QrType item:QrType.values()){
            if(item.getId() == id) return item;
        }
        return null;
    }

    public static QrType ofSid(String sid){
        for(QrType item:QrType.values()){
            if(item.getSid().equals(sid)) return item;
        }
        return null;
    }
}
